<template>
	<view class="">
		<view class="payway_box">
			<view class="payway_box_title">
				选择支付方式
			</view>
			<view class="payway_box_content">
				<radio-group @change="radioChange">
					<view class='payway_content_list' @click="choosePayWay(3)">
						<view class="img_left">
							<image src="../../../static/img/common/weixinzhifu.png"></image>
							<text style="margin-left: 10rpx;">微信支付</text>
						</view>
						<view>
							<radio :value="3" :checked="3 === current" color="#f62442" />
						</view>
					</view>
					<view class='payway_content_list' @click="choosePayWay(5)">
						<view class="img_left">
							<image src= "../../../static/img/common/zhifubao.png"></image>
							<text style="margin-left: 10rpx;">支付宝</text>
						</view>
						<view>
							<radio :value="5" :checked="5=== current" color="#f62442" />
						</view>
					</view>
				</radio-group>
				<!-- <view class="payway_box_more" v-if="flagMore" @click="handleTabMore">
					更多支付方式 <text class="icon-jiantouxia iconfont" style="font-size: 24rpx;color: #999; "></text>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		// canvas 宽度
		is_show_share_box: {
			type: Boolean,
			default: false
		},
		current: {
			type: Number,
			default: 3
		}
	},
	data() {
		return {
			flagMore: true,
			wayList: [{
				value: 3,
				name: "微信支付",
				url: "../../../static/img/common/weixinzhifu.png",
			},
			{
				value: 5,
				name: "支付宝",
				url: "../../../static/img/common/zhifubao.png",
			},
			],
			wayListMore: [{
				value: 3,
				name: "微信支付",
				url: "/static/wx_pay.png",
			},
			{
				value: 5,
				name: "支付宝",
				url: "/static/zfb_pay.png",
			},
			],
		};
	},
	methods: {

		radioChange: function (evt) {
			for (let i = 0; i < this.wayList.length; i++) {
				if (this.wayList[i].value === evt.target.value) {
					//this.current = i;
					this.$emit('changeNum', evt.target.value)
					break;
				}
			}
		},
		//
		choosePayWay(i) {
			this.$emit('changeNum', i)
		},
		//
		handleTabMore() {
			this.wayList = this.wayListMore;
			this.flagMore = false;
		},

	},

	mounted() {

	}

};
</script>

<style lang="scss">
.payway_box {
	margin-top: 20rpx;
	height: 100%;
	background-color: #fff;

	.payway_box_title {
		color: #999;
		font-size: 26rpx;
		margin: 20rpx;
		height: 60rpx;
		line-height: 60rpx;
		padding-left: 20rpx;
		// padding: 20rpx;
		border-bottom: 1px solid #eee;
	}

	.payway_box_content {
		width: 100%;
		height: 100%;

		.payway_box_more {
			font-size: 24rpx;
			text-align: center;
			height: 50rpx;
		}

		.payway_content_list {
			display: flex;
			justify-content: space-between;
			padding: 20rpx;
			margin: 20rpx;
			border-bottom: 1px solid #eee;

			.img_left {
				height: 65rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				image {
					width: 60rpx;
					height: 100%;
				}
			}
		}
	}
}
</style>
